package model.member;

import java.sql.SQLException;

public class MemberService {
	private MemberDao memberDao;
	
	public MemberService(){}

	public MemberService(MemberDao memberDao) {
		super();
		this.memberDao = memberDao;
	}
	
	public void registerMember(MemberVO vo) throws SQLException{
		memberDao.registerMember(vo);
	}
	
	public boolean idCheck(String id) throws SQLException{
		boolean flag=false;
		if(memberDao.idCheck(id)!=null){
			flag=true;
		}
		return flag;
	}
	
	public MemberVO login(MemberVO vo) throws SQLException {		
		return memberDao.login(vo);
	}
	
	public void updateMember(MemberVO vo) throws SQLException {		
		memberDao.updateMember(vo);
	}
	
	public void deleteMember(String id) throws SQLException {		
		memberDao.deleteMember(id);
	}
	
	public boolean findPass(String id, String name) throws SQLException{
		boolean flag=false;
		if(memberDao.findPass(id, name)!=null){
			flag=true;
		}
		return flag;
	}
	

	public String findId(MemberVO mvo) throws SQLException {
		return memberDao.findId(mvo);
	}

	public int showHint(MemberVO mvo) throws SQLException {
		return memberDao.showHint(mvo);
	}

	public String getPass(MemberVO mvo) throws SQLException {
		return memberDao.getPass(mvo);
	}

}
